package clearjerk.pic.view;

import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

@SuppressWarnings("serial")
public class GameCanvas extends Canvas {
	//private Color[][] pixels;
	BufferedImage pixels;
	public GameCanvas(BufferedImage pix){
		pixels = pix;
	}
	public void paint(Graphics g) {
		g.clearRect(0, 0, GameFrame.WIDTH, GameFrame.HEIGHT);
		super.paint(g);
		//int total = pixels.length*pixels[0].length;
		g.drawImage(pixels, 0, 0, pixels.getWidth(), pixels.getHeight(), null);
	}
	public void setPixels(BufferedImage colors){
		pixels=colors;
		repaint();
	}
}
